[PHP] Condition for array with string as keys

Posted by Kel on Stack Overflow See other posts from Stack Overflow or by Kel
Published on 2010-04-08T14:37:28Z Indexed on 2010/04/08 14:43 UTC
Read the original article Hit count: 296

Filed under:
|
|
|

My PL/SQL procedure returns a cursor. It always returns data. I fetch (oci_fetch_assoc) it and save it in an array. If results were found the keys of the array will be strings. If the cursor didn't find data, it will return value 0, thus the key of the array will be numeric.

while($data = oci_fetch_assoc($cursor)){
    if(!isset($data[0])){
       ...
    }
...
...
}

What's the best way to check that the array is not just 0, but contains data?

Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about array